import api from "./api"
import http from "./http"

export function Data(methods,url,data){
    methods == "get" ? data={params:data} : data;
    // console.log(url);
    return http[methods](
        api[url],
        data
    )
}

export function get(url,params){
    return new Promise((resolve,reject) => {
        http.get(url,{params}).then(res => {
            // console.log(res);
            resolve(res)
        }).catch(err => {
            // console.log(err);
            reject(err)
        })
    })
}